package com.xzy.spring.main;

import com.xzy.spring.config.AspectConfig;
import com.xzy.spring.demo.aspect.MathUtil;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author xzy
 * @date 2021/2/18 21:13
 * 说明：
 */
public class AspectMain {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(AspectConfig.class);
        MathUtil mathUtil = annotationConfigApplicationContext.getBean(MathUtil.class);

        System.out.println("目标类："+MathUtil.class);
        System.out.println("实际类：" + mathUtil.getClass());

        mathUtil.div(1, 1);
        mathUtil.div(1, 0);
    }
}
